DIR_SRC = ./src
INC_SRC = ./include

cc = g++ -std=c++11
LDFLAGS += -L/usr/local/lib
LIBS += -lcurl -lportaudio -lgstreamer-1.0 \
       -lgobject-2.0 -lglib-2.0 -lpthread

#cc = mipsel-openwrt-linux-g++ -std=c++11
#LDFLAGS += -L/home/saki/Work/openwrt_widora/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/lib


#LIBS += -lcurl -lportaudio -lasound -lgstreamer-1.0 \
       -lgobject-2.0 -lglib-2.0  -lcrypto -lnghttp2

CPPFLAGS += -I/home/saki/Work/Alexa -I/home/saki/Work/openwrt_widora/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/include/gstreamer-1.0 -I/home/saki/Work/openwrt_widora/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/include/glib-2.0 -I/home/saki/Work/openwrt_widora/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/include


all : alexa deviceinfo player
.PHONY : all
deviceinfo : $(DIR_SRC)/info.cpp
	$(cc) -o deviceinfo $(DIR_SRC)/info.cpp $(CPPFLAGS) $(LDFLAGS) $(LIBS)

player : $(DIR_SRC)/player.cpp $(INC_SRC)/player.h
	$(cc) -o player $(DIR_SRC)/player.cpp $(CPPFLAGS) $(LDFLAGS) $(LIBS)

alexa : base.o alexa.o main.o gstplayer.o alert.o
	$(cc) -o alexa base.o alert.o alexa.o main.o gstplayer.o $(CPPFLAGS) $(LDFLAGS) $(LIBS) -Wl,-rpath-link=/home/saki/Work/openwrt_widora/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/lib 

main.o : $(DIR_SRC)/main.cpp $(INC_SRC)/alexa.h $(INC_SRC)/base.h $(INC_SRC)/gstplayer.h
	$(cc) -c $(DIR_SRC)/main.cpp $(CPPFLAGS) $(LDFLAGS) $(LIBS) 

base.o : $(DIR_SRC)/base.cpp $(INC_SRC)/base.h
	$(cc) -c $(DIR_SRC)/base.cpp $(CPPFLAGS)

alexa.o : $(DIR_SRC)/alexa.cpp $(INC_SRC)/alexa.h $(INC_SRC)/base.h $(INC_SRC)/alert.h
	$(cc) -c $(DIR_SRC)/alexa.cpp $(CPPFLAGS) $(LDFLAGS) $(LIBS) 

alert.o : $(DIR_SRC)/alert.cpp $(INC_SRC)/alert.h
	$(cc) -c $(DIR_SRC)/alert.cpp $(CPPFLAGS)

gstplayer.o : $(DIR_SRC)/gstplayer.cpp $(INC_SRC)/gstplayer.h
	$(cc) -c $(DIR_SRC)/gstplayer.cpp $(CPPFLAGS) $(LDFLAGS) $(LIBS) 


.PHONY : clean
clean:
	-rm *.o alexa 
